xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
  xml.channel do
    xml.title "BeyondRails"
    xml.description "BeyondRails Rails 中文 社区 博客 教程 资源 论坛"
    xml.link HOME + "/index.rss"

    for b in @blogs
      xml.item do
        xml.title h(b.title)
        xml.author h(b.user.login)
        xml.description bbcode2html(b.content) + "<br/><a href='" + blog_url(b) +"#comments'>查看评论</a>"
        xml.pubDate b.created_at.to_s(:rfc822)
        xml.link blog_url(b)
        xml.guid blog_url(b)
      end
    end
    for t in @tutorials
      xml.item do
        xml.title h(t.title)
        xml.author h(t.user.login)
        xml.description bbcode2html(t.content)
        xml.pubDate t.created_at.to_s(:rfc822)
        xml.link tutorial_url(t)
        xml.guid tutorial_url(t)
      end
    end
    for r in @resources
      xml.item do
        xml.title h(r.title)
        xml.author h(r.user.login)
        xml.description bbcode2html(r.description)
        xml.pubDate r.created_at.to_s(:rfc822)
        xml.link resource_url(r)
        xml.guid resource_url(r)
      end
    end
    for p in @forums
      xml.item do
        xml.title h(p.title)
        xml.author h(p.user.login)
        xml.description bbcode2html(p.content)
        xml.pubDate p.created_at.to_s(:rfc822)
        xml.link post_url(p)
        xml.guid post_url(p)
      end
    end
  end
end